import Vue from 'vue'
import vueRouter from 'vue-router'
Vue.use(vueRouter)

const Foo = () => import('./view/foo.vue')
const Bar = () => import('./view/bar.vue')
// import Foo from './view/foo.vue'
// import Bar from './view/bar.vue'

const routes = [
  { path: '/foo', component: Foo },
  { path: '/bar', component: Bar }
]

const router = new vueRouter({
  routes // (缩写) 相当于 routes: routes
})
export default router
